<script setup lang="ts">
import {onMounted, ref} from "vue";
import Composition from "./components/Composition.vue";

const divRef = ref(null)
const target = ref(null)

onMounted(() => {
  console.log(divRef.value)
  /*Vue3中组件实例内部setup函数中的属性和方法是封闭性的，需要使用编译器宏函数暴露给外部使用*/
  console.log(target.value)
})

</script>

<template>
  <!--获取DOM元素-->
  <div ref="divRef">我是div</div>
  <!--获取组件实例-->
  <Composition ref="target"></Composition>
</template>
